//
// Created by wy on 2023/12/10.
//
#include <stdio.h>
#include "logutil.h"

void swap(int *x,int *y)
{
    printf("交换前：x地址=%0x,y的地址=%0x \n",&x,&y);
    printf("交换前：x指向的值=%d,y指向的值=%d \n",*x,*y);
    int t=0;
    t=*x;
    *x=*y;
    *y=t;
    printf("交换后 x地址=%0x,y的地址=%0x \n",&x,&y);
    printf("交换前：x指向的值=%d,y指向的值=%d \n",*x,*y);

}



int main(int argc, char *argv[]) {
    printf("test");
    char *path = {"\0"};
    char *key = "";
    char *config_file_path_name = "Config.ini";
    char *section = "";

    readIniConfigValue("", "", "LOG");
    FILE *file = fopen(path, "rb");
    if (file != NULL) {

    }


    int str[]={1,2,3,4,5};
    char *s=str;
    printf("sizeof(s)=%d\n",sizeof(s));
    for (int i = 0; i < sizeof(str); ++i) {
        printf("%d\n",*s++);
    }
//    printf("%d\n",*s++);
    printf("sizeof(str)=%d\n",sizeof(str));

    //数组名为地址类型
    printf("str的长度为: %d\n",sizeof(str));
    //数组长度  要除以每个元素的字节数，才能得到个数
    printf("str的个数为:%d\n",sizeof(str)/sizeof(str[0]));

    int x=10,y=20;
    printf("x=%d,y=%d \n",x,y);
    printf("x地址=%0x,y的地址=%0x \n",&x,&y);
    swap(&x,&y);

    printf("x=%d,y=%d \n",x,y);
    printf("x地址=%0x,y的地址=%0x \n",&x,&y);
}